//
//  MoreViewController.m
//  Demo0005
//
//  Created by zTercel on 13-6-24.
//  Copyright (c) 2013年 zTercel. All rights reserved.
//

#import<CoreText/CoreText.h>
#import "MoreViewController.h"

@interface MoreViewController ()

@end

@implementation MoreViewController

- (id)init
{
	NSLog(@"More视图视初始化(init)");
	self = [super init];
	if (self) {
	
	}
	return self;
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
	NSLog(@"More视图视初始化(initWithNibName)");
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
		//self.title	= @"更多...";
		//UIImage *image = [UIImage imageNamed:@"more.png"];
		self.tabBarItem.title	= @"More...";
		//self.tabBarItem.image = image;
    }
    return self;
}

- (void)loadView
{
	[super loadView];
	
	CGRect frame = [UIScreen mainScreen].applicationFrame;
	self.view = [[[UIView alloc] initWithFrame: frame] autorelease];
	
	NSString *content	= @"用户档案管理\n\nVersion 1.0";
	NSMutableAttributedString *attributedText	= [[[NSMutableAttributedString alloc] initWithString:content] autorelease];
	NSRange breakLineRange = [content rangeOfString:@"\n\n"];
	if (breakLineRange.length != 0) {
		NSInteger startPos = breakLineRange.location;
		NSRange range = NSMakeRange(startPos, content.length - startPos);
		[attributedText addAttribute:NSFontAttributeName
							   value:(id)[UIFont systemFontOfSize:24.0]
							   range: NSMakeRange(0, startPos)];
		[attributedText addAttribute:NSForegroundColorAttributeName
							   value:(id)[UIColor redColor]
							   range: range];
		[attributedText addAttribute:NSFontAttributeName
							   value:(id)[UIFont systemFontOfSize:13]
							   range: range];
	}
	
	CGSize	viewSize	= self.view.frame.size;
	UILabel	*label		= [[[UILabel alloc] initWithFrame:CGRectMake(0, (viewSize.height - 100)/3, viewSize.width, 100)] autorelease];
	label.attributedText= attributedText;
	label.lineBreakMode	= NSLineBreakByCharWrapping;
	label.numberOfLines	= 0;
	label.textAlignment	= NSTextAlignmentCenter;
	[self.view addSubview:label];
	
	return;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

	NSLog(@"More视图加载完成");
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];

	self.view = nil;  // 释放内存
}

- (void)viewWillAppear:(BOOL)animated
{
	NSLog(@"%@", @"More视图将显示");
}

- (void)viewDidAppear:(BOOL)animated
{
	NSLog(@"%@", @"More视图己显示");
}

- (void)viewWillDisappear:(BOOL)animated
{
	NSLog(@"%@", @"More视图将隐藏");
}

- (void)viewDidDisappear:(BOOL)animated
{
	NSLog(@"%@", @"More视图己隐藏");
}

@end
